package vn.mahjonggame.metadata;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.smartfoxserver.v2.entities.data.SFSObject;

public class GameAction {
	public String actor;
	public String actor_displayname;
	public String action;
	public String param_1;
	public String param_2;
	public String timestamp;
	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	public GameAction(String actor, String actor_displayname, String action, String param1, String param2){
		this.actor = actor;
		this.actor_displayname = actor_displayname;
		this.action = action;
		this.param_1 = param1;
		this.param_2 = param2;
		this.timestamp = sdf.format(new Date());
	}
	
	public SFSObject toSFSObject(){		
		Response.Builder object = new Response.Builder();
		object.actor(actor)
			.actor_displayname(actor_displayname)
			.action(action)
			.param_1(param_1)
			.param_2(param_2)
			.timestamp(timestamp);
		
		return object.build().getSFSObject();
	}
}
